package com.lswms.service;

import java.math.BigDecimal;

import javax.servlet.http.HttpServletRequest;

import com.lswms.common.page.PageInfo;
import com.lswms.common.page.PageRequest;
import com.lswms.common.service.CrudService;
import com.lswms.dto.YnPayRecordDTO;
import com.lswms.dto.vo.req.CashOutReq;
import com.lswms.dto.vo.req.ChargeReq;
import com.lswms.dto.vo.req.QueryAmountReq;
import com.lswms.dto.vo.resp.QueryAmountResp;
import com.lswms.dto.vo.resp.TradeListResp;
import com.lswms.entity.YnPayRecordEntity;
import com.lswms.entity.YnUserEntity;

/**
 * 支付记录表
 *
 * @author Mark sunlightcs@gmail.com
 * @since 1.0.0 2020-04-25
 */
public interface YnPayRecordService extends CrudService<YnPayRecordEntity, YnPayRecordDTO> {

	/**
	 * 充值
	 * @param dto
	 * @param ynuser
	 */
	public String charge(ChargeReq dto,YnUserEntity ynuser);
	/**
	 * 充值回调
	 * @param tradNo
	 * @param ynuser
	 * CHARGE:充值
	 */
	public String notify(String type,String tradNo,HttpServletRequest request);
	
	/**
	 * 提现
	 * @param dto
	 * @param ynuser
	 */
	public String cashOut(CashOutReq dto,YnUserEntity ynuser);
	/**
	 * 提现回调
	 * @param tradNo
	 * @param ynuser
	 * CHARGE:提现
	 */
	public String notifyCashOut(String type,String tradNo,HttpServletRequest request);

	/**
	 * 查询收入支出
	 * @param dto
	 * @param ynuser
	 * @return
	 */
	public QueryAmountResp queryAmount(QueryAmountReq dto, YnUserEntity ynuser);
	/**
	 * 交易记录
	 * @param dto
	 * @param ynuser
	 * @return
	 */
	public PageInfo<TradeListResp> tradeList(PageRequest dto,YnUserEntity ynuser);
	/**
	 * 添加交易记录
	 * @param userId
	 * @param bussId
	 * @param businessType
	 * @param type
	 * @param amt
	 * @param remark
	 */
	public String payrecord(Long userId,Long bussId,String businessType,String type,BigDecimal amt,String remark);


	/**
	 * 条件查询充值记录
	 * @param dto
	 * @param startTime
	 * @param endTime
	 * @return
	 */
	public PageInfo<YnPayRecordDTO> listByCondition(PageRequest dto,String startTime,String endTime);
	/**
	 * 每日数据
	 * @param s
	 * @param e
	 * @return
	 */
	public String cdata(String s,String e);
}